<template>
  <view class="content">
    引导页面

  </view>
</template>

<script>
import { linkloginFn } from '@/common/common';
export default {
  components: {
  },
  data() {
    return {
      billCode: ''

    }
  },
  onLoad(option) {
    if (option.billCode) {
      this.billCode = option.billCode;
    }
    setTimeout(this.checkLoginFn, 2000)
  },
  methods: {
    checkLoginFn() {
      if (this.vuex_loginStatus && this.vuex_accountInfo && this.vuex_accountInfo.loginAccount) {
        // console.log(7878)
        //  const params = {
        //       order_id: '66300076844',
        //       creatTime: 1666281599333,
        //       paid_amount: 28.3,
        //       payTime: 1,
        //       paidType:1201
        //  }

        // uni.redirectTo({
        //    url: `/subPages/payments/cashier/index?params=${JSON.stringify(params)}` //todo 跳转收银台
        // })

        //66300075244
        // uni.redirectTo({
        //   url: `/subPages/payments/transfer/index?params=${JSON.stringify(params)}`, //todo 跳转确认汇款
        // })

        // uni.navigateTo({
        //   url: `/subPages/payments/paySuccess/index?type=zqpay&order_id=66300075244&timeNum=1666281599333`
        // })

        //  const res = {
        //    orderId:66300076044,
        //    paid_amount:28.3
        //  }

        //  const res = {order_id: "66300088844", type: "hdfk", amount: "2957.7"}
        //  uni.redirectTo({
        //    url: `/subPages/payments/paySuccess/index?order_id=${res.order_id}&type=hdfk&amount=${res.paid_amount}` //todo 跳转收银台
        // })

        if (this.billCode) {
          uni.redirectTo({
            url: '/pages/dnventoryDetail/index?billCode=' + this.billCode
          })
        }

        if (!this.billCode) {
          uni.redirectTo({
            url: '/pages/index/index'
          })
        }

        //  uni.navigateTo({
        //     url: '/pages/confirmOrder/index?billCode=QD202210210000002'
        //  })
      } else {
        this.returnLoginFn()
      }
    },
    returnLoginFn() {
      linkloginFn({
        type: 'pageIndex',
        callbackUrl: `/pages/index/index`,
        urlParams: JSON.stringify({ billCode: this.billCode })
      })
    },
  }
}
</script>

<style>

</style>
